<template>
	<view>
		<xy-list-item
			:key="item.id"
			v-for="item in dataList"
			type="media"
			:image="item.avatar"
			:title="item.name"
			contentStyle="align-self: center;"
			titleFs="15px">
			<view slot="titleRight">
				{{item.createTime | formatTime}}
			</view>
			<template slot="info">
				<view class="left p-t-xs text-gray">
					<view class="des m-b-xs">
						手机号：{{item.tel ? item.tel : '***********'}}
					</view>
				</view>
				<view class="right p-t-xs font-sm text-gray">

				</view>
			</template>
		</xy-list-item>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				dataList: []
			}
		},
		onLoad() {
			this.loadData();
		},
		onShareAppMessage(res) {
			if (res.from === 'button') {// 来自页面内分享按钮
				console.log(res.target)
			}
			return {
				title: this.$store.state.app.siteInfo.title,
				path: '/pages/user_invite/invite/my'
			}
		},
		methods: {
			async loadData() {
				let res = await this.util.request({
					url: '/v1/user_invite/invite/my',
					method: 'get'
				});
				if (res.code == 200) {
					this.dataList = res.data.dataList;
				}
			}
		}
	}
</script>

<style lang="scss" scoped>
	/deep/ .xy-list-item .left .image {
		width: 50px;
		height: 50px;
		border-radius: 50%;
		overflow: hidden;
		margin-right: 10px;
	}
</style>
